const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  visitedViews: state => state.tagsView.visitedViews,
  cachedViews: state => state.tagsView.cachedViews,
  avatar: state => state.user.avatar,
  name: state => state.user.name,
  token: state => state.user.token,
  introduction:state => state.user.introduction,
  age:state => state.user.age,


  //类似计算属性computed  默认属性state,getters且只接受这两个参数
  pingfang(state){
    return state.count**2
  },
  //state不能漏★★★★
  filterStu(state){
    return state.students.filter(s=>s.age>20)
  },
  //注意第二个参数(固定的)  上面的属性值是可以给后面用的getters是上面:前的getters★★★
  filterStuLength(state,getters){
    return getters.filterStu.length
  },
  //封装帅选年龄的接口(函数)
  moreAgeStu(state){
    return function (inputAge) {
      return state.students.filter(s=>s.age>inputAge)
    }
  }
}
export default getters
